package org.prs.model;

import com.prs.util.DateUtil;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import org.prs.persistence.UserDatabasePersitenceManager;

public class User {

    private int userId;
    private String username;
    private String password;
    private String firstName;
    private String lastName;
    private String middleName;
   // private String dateRegistered;
    private Date dateRegistered;
    private int userLevel;

    public User() {
        this.userId = 0;
        this.username = "";
        this.password = "";
        this.firstName = "";
        this.lastName = "";
        this.middleName = "";
        this.dateRegistered = Calendar.getInstance().getTime();
        this.userLevel = 0;
    }

    public int getUserLevel() {
        return userLevel;
    }

    public void setUserLevel(int userLevel) {
        this.userLevel = userLevel;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getMiddleName() {
        return middleName;
    }

    public void setMiddleName(String middleName) {
        this.middleName = middleName;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Date getDateRegistered() {
        return dateRegistered;
    }

    public void setDateRegistered(Date dateRegistered) {
        this.dateRegistered = dateRegistered;
    }

    

   
    public static void main(String args[]) {
        UserDatabasePersitenceManager persistUser = new UserDatabasePersitenceManager();
        List<User> users = persistUser.getAllUsers(0, persistUser.getAllUsersCount());
        System.out.println(users.size());
        System.out.println(persistUser.getUserByUsername("richard").getUsername());
        boolean test=users.remove(persistUser.getUserByUsername("richard"));
        System.out.println(users.contains(persistUser.getUserByUsername("richard")));
        System.out.println(users.size());
    }
}
